<?php /* Smarty version 2.6.20, created on 2016-07-19 15:20:07
         compiled from share_list.htm */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>分享列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/yahoo-dom-event/yahoo-dom-event.js" ></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/dragdrop/dragdrop-min.js" ></script>
<script type="text/javascript" src="../module/inventory/scripts/yui/calendar/calendar-min.js"></script>
<script type="text/javascript" src="../module/inventory/scripts/index.js"></script>
<script type="text/javascript">
    $(function(){
        /* 全选 */
         $('.checkall').click(function(){
            var _self = this;
            $('.checkitem').each(function(){
                if (!this.disabled)
                {
                    $(this).attr('checked', _self.checked);
                }
            });
            $('.checkall').attr('checked', this.checked);
        });
    });
    
  //展开标签信息
    function showOrHideTagInfo(snsId){
        var flag = false;
        if(flag){
        	return;
        }
    	var ctag = $('#show_pic_tags_'+snsId);
    	var tclass = ctag.attr('tagsta');
    	flag = true;
    	if(tclass=='show'){
    		$.get('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=sns&s=sns.php&act=get_pic_tags&sns_id='+snsId,function(data){
    			ctag.parent().parent().after(data);
    			ctag.attr('tagsta','hide');
    			ctag.attr('src','../image/admin/hidechild.png');
    			flag = false;
    		});
    	}else if(tclass=='hide'){
    		$('#tagH_'+snsId).remove();
    		$('.tagC_'+snsId).remove();
    		ctag.attr('tagsta','show');
    		ctag.attr('src','../image/admin/addchildboard.png');
    	}
    }
  //保存标题
  	function saveTitle(snsId){
  		if(snsId>0){
  			var title = $('#title_'+snsId).val();
  			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=sns&s=sns.php',{"snsid":snsId,"title":title,"act":"saveTitle"},function(s){});
  		}
  	}
    //保存评论内容
    function saveComment(comId){
        if(comId>0){
            var comment = $('#comment_'+comId).val();
            $.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=sns&s=sns.php',{"id":comId,"comment":comment,"act":"saveComment"},function(s){});
        }
    }
</script>
</head>
<body>
<div class="container">
	<?php if ($_GET['act'] == 'getFavoriteMember'): ?>
		<div class="flow">
	        <div class="itemtitle">
	            <h3>点赞会员</h3>
	            <ul>
                    <li><a href="?m=sns&s=sns.php"><span>分享列表</span></a></li>
                </ul>
	        </div>
	    </div>
	    
	    <div class="h35"></div>

	    <table class="table product">
	        <tbody>
	            <tr class="header">
	                <th width="50">用户ID</th>
	                <th width="100">用户名称</th>
	                <th width="100">用户头像</th>
	                <th width="50">性别</th>
	                <th width="100">手机</th>
	                <th width="100">邮箱</th>
	                <th width="50">注册时间</th>
	            </tr>
	            <?php $_from = $this->_tpl_vars['de']['favoriteMembers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
	            <tr>
	                <td><?php echo $this->_tpl_vars['list']['userid']; ?>
</td>
	                <td><?php echo $this->_tpl_vars['list']['username']; ?>
</td>
	                <td width="80">
	                	<img width="60" height="60" class="img" src="<?php echo $this->_tpl_vars['list']['logo']; ?>
" />
	                </td>
	                <td><?php if ('1' == $this->_tpl_vars['list']['sex']): ?>男<?php else: ?>女<?php endif; ?></td>
	                <td><?php echo $this->_tpl_vars['list']['mobile']; ?>
</td>
	                <td><?php echo $this->_tpl_vars['list']['email']; ?>
</td>
	                <td><?php echo $this->_tpl_vars['list']['regtime']; ?>
</td>
	            </tr>
	            <?php endforeach; else: ?>
	            <tr>
	                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
	            </tr>
	            <?php endif; unset($_from); ?>
	        </tbody>
	        <tfoot>
	            <tr>
	                <td colspan="99"><div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div><?php if ($this->_tpl_vars['countpro']): ?>共有<?php echo $this->_tpl_vars['countpro']; ?>
条记录<?php endif; ?></td>
	            </tr>
	        </tfoot>
	    </table>
	<?php elseif ($_GET['act'] == 'getCommentsList'): ?>
	   <div class="flow">
            <div class="itemtitle">
                <h3>评论列表</h3>
                <ul>
                    <li><a href="?m=sns&s=sns.php"><span>分享列表</span></a></li>
                </ul>
            </div>
        </div>
        
        <div class="h35"></div>
        
        <form action="" method="get">
        <input type="hidden" name="m" value="sns">
        <input type="hidden" name="s" value="sns.php">
        <input type="hidden" name="snsid" value="<?php echo $_GET['snsid']; ?>
">
        <input type="hidden" name="act" value="getCommentsList">
            <tbody>
                <tr>
                    <td width="20">状态:</td>
                    <td width="30">
                        <select name="status">
                            <option value="">有效</option>
                            <option value="0" <?php if ('0' == $_GET['status']): ?>selected<?php endif; ?>>已禁用</option>
                            <option value="1" <?php if ('1' == $_GET['status']): ?>selected<?php endif; ?>>正常显示</option>
                        </select>
                    </td>
                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td><input id="search" type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
                </tr>
                
            </tbody>
        </table>
        </form>

        <form action="" method="get">
        <input type="hidden" name="m" value="sns">
        <input type="hidden" name="s" value="sns.php">
        <input type="hidden" name="sns_id" value="<?php echo $_GET['snsid']; ?>
">
        <table class="table product">
            <tbody>
                <tr class="header">
                    <th width="20"><input type="checkbox" class="checkall" ></th>
                    <th width="50">楼层</th>
                    <th colspan="2">用户</th>
                    <th width="100">评论内容</th>
                    <th width="50">评论时间</th>
                    <th width="50">状态</th>
                </tr>
                <?php $_from = $this->_tpl_vars['de']['comment_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <tr>
                    <td><input type="checkbox" value="<?php echo $this->_tpl_vars['list']['id']; ?>
" class="checkitem" name="chksnscomments[]"></td>
                    <td><?php echo $this->_tpl_vars['list']['floor']; ?>
</td>
                    <td class="al" width="80" valign="top"><img class="img" alt="<?php echo $this->_tpl_vars['list']['name']; ?>
" src="<?php if (! $this->_tpl_vars['list']['logo']): ?>/image/logo.png<?php else: ?><?php echo $this->_tpl_vars['list']['logo']; ?>
/92<?php endif; ?>" width="80" /></td>
                    <td class="al" width="50">
                        <p>昵称：<a href="?m=sns&s=sns.php&act=getCommentsList&snsid=<?php echo $_GET['snsid']; ?>
&member_id=<?php echo $this->_tpl_vars['list']['userid']; ?>
"><?php echo $this->_tpl_vars['list']['name']; ?>
</a></p>
                        <p>动作：<?php if ($this->_tpl_vars['list']['aplay_name']): ?>回复 <?php echo $this->_tpl_vars['list']['aplay_name']; ?>
<?php else: ?>评论分享<?php endif; ?></p>
                    </td>
                    <td><textarea id="comment_<?php echo $this->_tpl_vars['list']['id']; ?>
" style="height:50px;" onblur="javascript:saveComment(<?php echo $this->_tpl_vars['list']['id']; ?>
);"><?php echo $this->_tpl_vars['list']['content']; ?>
</textarea></td>
                    <td><?php echo $this->_tpl_vars['list']['create_time']; ?>
</td>
                    <td>
                        <?php if ('0' == $this->_tpl_vars['list']['status']): ?>禁用<?php endif; ?>
                        <?php if ('1' == $this->_tpl_vars['list']['status']): ?>显示<?php endif; ?>
                    </td>
                </tr>
                <?php endforeach; else: ?>
                <tr>
                    <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
                </tr>
                <?php endif; unset($_from); ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="99">
                        状态设置:
                        <select name="set_status">
                            <option value="">--请选择--</option>
                            <option value="-1" >删除</option>
                            <option value="0" >禁用</option>
                            <option value="1" >显示</option>
                        </select>
                        <input type="hidden" name="act" value="comment_op" />
                        <input type="submit" value="提交" />
                        <div class="page"><span style="float:left;line-height: 20px;"><?php if ($this->_tpl_vars['countpro']): ?>共有<?php echo $this->_tpl_vars['countpro']; ?>
条记录<?php endif; ?></span><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
                    </td>
                </tr>
            </tfoot>
        </table>
        </form>
	<?php else: ?>
	    <div class="flow">
	        <div class="itemtitle">
	            <h3>分享列表</h3>
	        </div>
	    </div>
	    
	    <div class="h35"></div>
	    
	    <form action="" method="get">
	    <input type="hidden" name="m" value="sns">
	    <input type="hidden" name="s" value="sns.php">
	    <table class="select_table">
	        <tbody>
	            <tr>
	                <td width="60">分享ID:</td>
                    <td width="100"><input id="sns_id" type="text" name="sns_id" class="w100" value="<?php echo $_GET['sns_id']; ?>
" /></td>
	                <td width="60">分享时间:</td>
	                <td class="yui-skin-sam" width="150">
	                	<input style="width:70px;" id="sdate" name="sdate" type="text" size="12" value="<?php echo $_GET['sdate']; ?>
" onfocus="lockinput(this)" autocomplete="off"/>
	                	<input style="width:70px;" id="edate" name="edate" type="text" size="12" value="<?php echo $_GET['edate']; ?>
" onfocus="lockinput(this)" autocomplete="off"/>
	            		<div id="calContainer" style="display:none; position:absolute;"></div>
            		</td>
	                <td width="60">会员名称:</td>
	                <td width="100"><input id="username" type="text" name="username" class="w100" value="<?php echo $_GET['username']; ?>
" /></td>
	                <td width="20">标签:</td>
	                <td width="100"><input id="tagname" type="text" name="tagname" class="w100" value="<?php echo $_GET['tagname']; ?>
" /></td>
	                <td width="20">品牌:</td>
	                <td width="100">
	                	<input type="hidden" name="brandid" class="brandid" value="<?php echo $_GET['brandid']; ?>
"/>
	                	<input style="width:150px;" type='text' name='brand' class='brands' value="<?php echo $_GET['brand']; ?>
" placeholder='输入搜索词' autocomplete="off"/>
	            		<ul class="brandlist" style="display:none;position:absolute;background-color:#fff;border: 1px solid rgb(207, 201, 201);width: 150px;">
	        			</ul>
	                </td>
                </tr>
                <tr>
	                <td width="20">状态:</td>
	                <td width="30">
	                	<select name="status">
	                		<option value="">有效</option>
	                		<option value="-1" <?php if ('-1' == $_GET['status']): ?>selected<?php endif; ?>>已删除</option>
	                		<option value="0" <?php if ('0' == $_GET['status']): ?>selected<?php endif; ?>>已禁用</option>
	                		<option value="1" <?php if ('1' == $_GET['status']): ?>selected<?php endif; ?>>正常显示</option>
	                		<option value="2" <?php if ('2' == $_GET['status']): ?>selected<?php endif; ?>>推荐显示</option>
	                	</select>
	                </td>
	                <input type="hidden" id="order" name="" value="" />
	                <td><input id="search" type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
	            </tr>
	            
	        </tbody>
	    </table>
	    </form>
	
		<form action="" name="snsform" method="get">
		<input type="hidden" name="m" value="sns">
	    <input type="hidden" name="s" value="sns.php">
	    <table class="table product">
	        <tbody>
	            <tr class="header">
	                <th width="20"><input type="checkbox" class="checkall" ></th>
	                <th width="30"></th>
	                <th width="50">分享ID</th>
	                <th width="100">分享图片</th>
	                <th width="100">分享标题</th>
	                <th width="150">会员信息</th>
	                <th width="50"><a href="javascript:doorder('order','<?php if ($_GET['order'] == desc): ?>asc<?php else: ?>desc<?php endif; ?>');">点赞数</a></th>
	                <th width="50"><a href="javascript:doorder('commentsorder','<?php if ($_GET['commentsorder'] == desc): ?>asc<?php else: ?>desc<?php endif; ?>');">评论数</a></th>
	                <th width="50"><a href="javascript:doorder('timeorder','<?php if ($_GET['timeorder'] == desc): ?>asc<?php else: ?>desc<?php endif; ?>');">分享时间</a></th>
	                <th width="100">状态</th>
	            </tr>
	            <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
	            <tr>
	                <td><input type="checkbox" value="<?php echo $this->_tpl_vars['list']['id']; ?>
" class="checkitem" name="chksns[]"></td>
	                <td><img id="show_pic_tags_<?php echo $this->_tpl_vars['list']['id']; ?>
" tagsta="show" style="cursor:pointer;width:14px;height:14px;" onclick="javascript:showOrHideTagInfo(<?php echo $this->_tpl_vars['list']['id']; ?>
);" src="../image/admin/addchildboard.png" /></td>
	                <td><?php echo $this->_tpl_vars['list']['id']; ?>
</td>
	                <td>
	                	<img class="img" src="<?php if ($this->_tpl_vars['list']['pic'] != ''): ?><?php echo $this->_tpl_vars['img_url_pre']; ?>
<?php echo $this->_tpl_vars['list']['pic']; ?>
/80<?php else: ?>../image/admin/no_picture.jpg<?php endif; ?>" onerror="this.src='../image/admin/sns_img_fail_min.jpg'" width="80" height="80" <?php if ($this->_tpl_vars['list']['pic'] != ''): ?>onmouseover="javascript:showOriginImg('<?php echo $this->_tpl_vars['img_url_pre']; ?>
<?php echo $this->_tpl_vars['list']['pic']; ?>
');" onmouseout="javascript:hideOriginImg();"<?php endif; ?>/>
                	</td>
	                <td><textarea id="title_<?php echo $this->_tpl_vars['list']['id']; ?>
" style="resize:none;" onblur="javascript:saveTitle(<?php echo $this->_tpl_vars['list']['id']; ?>
);"><?php echo $this->_tpl_vars['list']['title']; ?>
</textarea></td>
	                <td width="80">
	                	<img width="40" height="40" class="img" src="<?php echo $this->_tpl_vars['list']['member_photo']; ?>
" />
						<span>
							<p>会员ID：<?php echo $this->_tpl_vars['list']['member_id']; ?>
</p>
		                	<p>会员名称：<?php if ('' == $this->_tpl_vars['list']['member_name']): ?>暂无<?php else: ?><?php echo $this->_tpl_vars['list']['member_name']; ?>
<?php endif; ?></p>
						</span>
	                </td>
	                <td><a style="color:blue;text-decoration:underline;" href="?m=sns&s=sns.php&act=getFavoriteMember&snsid=<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['favoriteNum']; ?>
</a></td>
	                <td><a style="color:blue;text-decoration:underline;" href="?m=sns&s=sns.php&act=getCommentsList&snsid=<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['comments_num']; ?>
</a></td>
	                <td><?php echo $this->_tpl_vars['list']['create_time']; ?>
</td>
	                <td>
	                <?php if ('-1' == $this->_tpl_vars['list']['status']): ?>已删除<?php endif; ?>
	                <?php if ('0' == $this->_tpl_vars['list']['status']): ?>违规禁用<?php endif; ?>
	                <?php if ('1' == $this->_tpl_vars['list']['status']): ?>正常显示<?php endif; ?>
	                <?php if ('2' == $this->_tpl_vars['list']['status']): ?>推荐显示<?php endif; ?>
	                </td>
	            </tr>
	            <?php endforeach; else: ?>
	            <tr>
	                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
	            </tr>
	            <?php endif; unset($_from); ?>
	        </tbody>
	        <tfoot>
	            <tr>
	                <td colspan="99">
	                	状态设置:
	                	<select name="set_status">
	                		<option value="">--请选择--</option>
	                		<option value="-1" >删除</option>
	                		<option value="0" >禁用</option>
	                		<option value="1" >正常</option>
	                		<option value="2" >推荐</option>
	                	</select>
		                <input type="hidden" name="act" value="op" />
	                    <input type="submit" value="提交" />
	                	<div class="page"><span style="float:left;line-height: 20px;"><?php if ($this->_tpl_vars['countpro']): ?>共有<?php echo $this->_tpl_vars['countpro']; ?>
条记录<?php endif; ?></span><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
	                </td>
	            </tr>
	        </tfoot>
	    </table>
	    </form>
    <?php endif; ?>
</div>
<div id="snsImgDetail" align="center" style="position:fixed;top:30px;left:30%;display:none;"><img width="560" height="560" src="" onerror="this.src='../image/admin/sns_img_fail_min.jpg'" /></div>
</body>
<script>
//排序
function doorder(key,value){
	var order = $('#order');
	order.attr('name',key);
	order.attr('value',value);
	
	$('#search').trigger('click');
}
//展示分享图片原图
function showOriginImg(src){
	var snsImgDetail = $("#snsImgDetail");
	snsImgDetail.find('img').attr('src',src+"/560"); 
	snsImgDetail.show();
}
//隐藏分享图片原图
function hideOriginImg(){
	$("#snsImgDetail").hide();
}

$(function(){
	//默认待选品牌
	$('.brands').bind('click',function(e){
			$.get('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=activity&s=activity.php&operation=getbrand&brandname=',function(data){
				$('.brandlist').show();
				$('.brandlist').html(""+data);
			});
	});
	//直接搜品牌
	$('.brands').bind('input',function(e){
		var value=$(this).val();
		if(value==''){
			$('.brandlist').hide();
			return ;
		}
		else{
			$.get("<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=activity&s=activity.php&operation=getbrand&brandname="+value,function(data){
				$('.brandlist').show();
				$('.brandlist').html(""+data);
			});
		}
	});
	$('body').bind('click',function(e){
		$('.brandlist').hide();
	});
	$('.brandlist').delegate('li','click',function(){
		var _this=$(this);
		var brandName=_this.text();
			var brandId=_this.attr('bid');
			$('.brands').val(brandName);
			$('.brandid').val(brandId);
			$('.brandlist').hide();
	});
});
</script>
</html>